package com.common.manager;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.common.component.Pagination;
import com.framework.model.IData;
import com.framework.model.IDataModel;
import com.framework.model.IDataset;
import com.framework.model.impl.DatasetList;
import com.framework.service.IbatisService;

public abstract class BaseManager  extends IbatisService{
	protected static Log log = LogFactory.getLog(BaseManager.class);
	
	
	public IDataset getPageObjectList(IDataModel objData){
		
		IDataset dataList = new DatasetList();
	
		return dataList;
	}
	
	public List getPageObjectList(Pagination page,IDataModel objData){
		
		List dataList = null;
		int recordNum = super.getRecordCount(objData);
		if(recordNum>0){
			dataList = super.getPageObjectList(objData, page.getPageCurrent(), page.getPageSize());
			page.setTotalCount(recordNum);
		}
		return dataList;
	}
	
	public List getPageObjectList(Pagination page,IData objData){
		
		List dataList = null;
		int recordNum = super.getRecordCount(objData);
		if(recordNum>0){
			dataList = super.getPageObjectList(objData, page.getPageCurrent(), page.getPageSize());
			page.setTotalCount(recordNum);
		}
		return dataList;
	}
	
}
